package com.chenyongjing.design.pattern.composite.demo.transparent;

public class Course extends CourseComponet{

//    private CoursePackage items;
    private String name;
    private Double price;

    public Course(String name, Double price) {
        this.name = name;
        this.price = price;
    }

    @Override
    public String getName(CourseComponet componet) {
        return this.name;
    }

    @Override
    public Double getPrice(CourseComponet componet) {
        return this.price;
    }

    @Override
    public void print() {
        System.out.println(this.name+"(￥"+price+")");
    }
}
